phantom.injectJs('spider.js');
spider.addTask({
	delay: 0,
	url: 'http://image.baidu.com/i?tn=list&word=liulan#%E7%BE%8E%E5%A5%B3|%E5%85%A8%E9%83%A8',
	handler: function(){
		var toPost = [];
		$('img[obj_url]').each(function(){
			var pic_url = $(this).attr('obj_url'),
				pic_key = 'baidu_' + $(this).attr('src');
			toPost.push({
				'pic_url' : pic_url,
				'pic_key' : pic_key,
				'source'  : 'baidu',
				'trust'   : 1
			});
		});

		_submit(toPost);

		// $.post('http://admin.shenmu.com/remote/new',{pics: JSON.stringify(toPost)}, function(text){
		// 	console.log(text);
		// 	console.log("CMD:exit");
		// 	//phantom.exit();
		// });
	}
});